package com.xindaoapp.framework.base;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

public abstract class BasePager implements OnClickListener{
	public Context ct;
	private LayoutInflater inflater;
	private View view;
	public boolean isLoadSuccess = false;
	public TextView txt_title;

	public BasePager(Context ct) {
		this.ct = ct;
		inflater = (LayoutInflater) ct
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		view = initView(inflater);
		setListener();
	}

	public BasePager() {
		super();
	}

	public View getRootView() {
		return view;
	}

	
	/**
	 * 初始化顶部视图
	 * 
	 * @param inflater
	 * @return
	 */
	public abstract View initView(LayoutInflater inflater);


	/**
	 * 初始化数据
	 */
	public abstract void initData();

	@Override
	public void onClick(View v) {
		
	}
	
	/**
	 * 设置监听器
	 */
	protected abstract void setListener();
	

}
